<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
     <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link type="text/css" rel="stylesheet" href="css/detail.css">
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript">
$(document).ready(
		function(){
			var s = $("img").attr("src");
			s=s.substring(6,s.length-4);
			$("select").find("option:contains('"+s+"')").attr("selected",true);
			
			$("select").change(function(){
				var t = $("select").find("option:selected").text();
				t = "image/"+t+".jpg";
				
				$("img").attr("src",t);
			});
			$("#shopname").blur(function(){
				$.ajax({
					url:"checkShopName.do",
					data:{
						shopname:$("#shopname").val()
					},
					success:function(data){
						var obj = JSON.parse(data);
						alert(obj.msg);
					}
				});
			});
		});
</script>
</head>
<body>
<div class="tablediv">
<form action="addShop.do">
<table border="1" width="100%" height="200px" style="table-layout:fixed;"
cellspacing = "0" cellpadding="0">
<caption><h1>店铺信息</h1></caption>
<tr><td>店铺ID</td><td><input type="text" name="id" disabled="disabled"></td>
<td rowspan="8"><img alt="" src="image/pic5.jpg" width="100%" height="100%"></td>
</tr>
<tr><td>店铺名称</td><td><input type="text" name="shopname" id="shopname"></td></tr>
<tr><td>店铺地址</td><td><input type="text" name="address"></td></tr>
<tr><td>店铺电话</td><td><input type="text" name="phonenum"></td></tr>
<tr><td>店铺简介</td><td><input type="text" name="intro"></td></tr>
<tr><td>店铺等级</td><td><input type="text" name="level"></td></tr>
<tr><td>店铺备注</td><td><input type="text" name="comment"></td></tr>
<tr><td>店铺图片</td><td><select width="100%" height="100%" name="pic">
<c:forEach items="${list }" var="pic">
<option>
${fn:substringBefore(pic,'.') }
</option>
 </c:forEach>
</select></td></tr>
<tr><td colspan="3"><button id="tijiao">提交</button></td></tr>
</table>
</form>
</div>

</body>
</html>